- /* scfatanh.cpp by K.Tsuru */
- // function ID = 9120 since ver 2.18
- /*****************************************
- SComplex class
- It returns artanh(z).
- Catanh(z) = Clog{(1+z)/(1-z)}/2
- = (1/i)arctan(iz). ver 2.21
- When z = x(pure real),let atanh(x) = p,
- -1 < x = tanh(p) < 1 must be satisfied.
- *****************************************/
- #ifndef SN_H
- #include "sn.h"
- #endif
-
- #if 0
- SComplex Catanh(const SComplex& z) {
- if(Im(z) == 0.0) { // z = x
- if( Dabs(Re(z)) >= 1.0) z.Real().SetError(z.Real().DOMAIN_ERR, "Catanh(z) with z = x(|x| > 1.0))", 9120);
- }
- SComplex y = (ONE + z)/(ONE - z);
-
- return CsDiv(Clog(y), 2);
- }
- #else /********************************/
-
- SComplex Catanh(const SComplex& z) {
- if(Im(z) == 0.0) {
- if( Dabs(Re(z)) >= 1.0) z.Real().SetError(z.Real().DOMAIN_ERR, "Catanh(z) with z = x(|x| > 1.0))", 9120);
- }
- return MI*Catan(IU*z); // (1/i)arctan(iz)
- }
- #endif
-
scfatanh.cpp : last modifiled at 2016/08/25 16:39:08(918 bytes)
created at 2017/10/06 15:21:28
The creation time of this html file is 2017/10/06 15:27:08 (Fri Oct 06 15:27:08 2017).